package com.example.aitoedu.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

@Accessors(chain = true)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class QuestionVO {

    @Schema(description = "题目标识id")
    private Long id;

    @Schema(description = "题目序号")
    private Long numberId;

    @Schema(description = "题目类型:1单选,2多选,3判断,4填空,5论述")
    private Integer type;

    @Schema(description = "题目")
    private String question;

    @Schema(description = "选项,类型为判断填空论述时为null")
    private String opt;

    @Schema(description = "非判断答案(仅用于查询数据库)(若为学生查询则是学生的自己的答案)")
    private String answer;

    @Schema(description = "判断答案,1正确,0错误(仅用于查询数据库)(若为学生查询则是学生的自己的答案)")
    private Integer ajudge;

    @Schema(description = "非判断答案")
    private String rightAnswer;

    @Schema(description = "判断答案")
    private int rightAjudge;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime createTime;

    @Schema(description = "若为选择则是选项总个数,填空则为空的个数,其余为null")
    private Integer number;

    @Schema(description = "题目分数")
    private Integer score;

    @Schema(description = "题目状态:0为错,1为对,2为未做，3半对半错(教师查询时忽略此字段)")
    private Integer stuStatus;

    @Schema(description = "学生此题得分")
    private Integer stuScore;

    @Schema(description = "若为填空则是填空各空的分值，其余为null")
    private String everyBlank;

    @Schema(description = "若为多选则是多选的少选的分值，其余为null")
    private Integer shortChoose;

    @Schema(description = "选项(处理后)")
    @TableField(exist = false)
    private List<String> opts;

    @Schema(description = "非判断答案(处理后)")
    @TableField(exist = false)
    private List<String> answers;

    @Schema(description = "非判断答案(正确的)(处理后)")
    @TableField(exist = false)
    private List<String> rightAnswers;

    @Schema(description = "若为填空则是填空各空的分值(处理后)")
    @TableField(exist = false)
    private List<Integer> everyBlanks;

    @Schema(description = "无用字段，专门给前端绑定v-model使用")
    private List noUse = new ArrayList<>();
}
